package com.bwie.mq;

import com.bwie.pojo.po.UserPo;
import com.bwie.utils.SendMsgUtil;
import org.apache.commons.lang3.SerializationUtils;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageListener;

/**
 * @className: MessageConsumer
 * @Description: TODO
 * @version: v1.８.0
 * @author: 杜林涛
 * @date: 2025/6/11 12:14
 */
public class MessageConsumer implements MessageListener {
    @Override
    public void onMessage(Message message) {
        byte[] body = message.getBody();

        UserPo userPo = SerializationUtils.deserialize(body);

        System.out.println(userPo);

        SendMsgUtil.sendSms(userPo.getPhone(),"1111");
    }
}
